package top.jimc.spring.javaconfig;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author Jimc.
 * @since 2018/9/27.
 */
public class App {

    public static void main(String[] args) {
//        ApplicationContext context = new AnnotationConfigApplicationContext(HelloWorldConfig.class);// 加载指定配置文件
        ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);// 可以加载多个配置文件

        HelloWorld helloWorld = (HelloWorld) context.getBean("helloWorld");

        helloWorld.say();
    }
}
